<template>
  <div>
    <van-nav-bar
      :z-index="999"
      :fixed="true"
      left-arrow
      @click-left="onClickLeft"
      :placeholder="true"
      title="教学环境"
    ></van-nav-bar>
    <!-- <img
        v-for="(item, index) in images"
        :key="index"
        :src="item.fileurl"
        @click="
      magnifyImage(item.fileurl)"
      /> -->
    <div class="dp-list">
      <div class="dp-item" v-for="(item, index) in images" :key="index">
        <img :src="item.fileurl" @click="magnifyImage(item.fileurl)" />
      </div>
    </div>
  </div>
</template>

<script>
import { baseURL } from "../../assets/js/config";
import { ImagePreview } from "vant";
import { coachEnvironment } from "../../assets/js/api/apply";
export default {
  name: "CoachEnvironment",
  data() {
    return {
      images: []
    };
  },
  created() {
    let dsBridge = require("dsbridge");
    dsBridge.call("goBack", "", function() {
      history.go(-1);
    });

    this.baseURL = baseURL;
    // console.log(this.$route.params.lid);
    coachEnvironment(this.$route.params.lid).then(res => {
      this.images = res.data;
      // console.log(res.data);
    });
  },
  methods: {
    magnifyImage(url) {
      ImagePreview([url]);
    },

    onClickLeft() {
      this.$router.go(-1);
    }
  }
};
</script>

<style></style>
